/*
 * @Description: 员工管理接口
 */
// import zhreq from "@/api/axios-twoline";
import zhreq from "@/api/axios";
export default {
  /**
   * @description: 获取员工列表 *代表必填
   * @param {String/Number} page *
   * @param {String/Number} size *
   * @param {Object} entity {componyId: 1} *
   * @param {String} order 排序方式 ASC DESC 默认ASC
   * @param {String} sort 自定义排序方式 'createTime'
   * @return {Array}
   */
  getEmployeeList(params) {
    return zhreq.post("v3/organization/employee/queryPageList", {
      page: params.page,
      size: params.size,
      sort: "timestamp",
      entity: {
        organizationNo: sessionStorage.organizationNo
        // companyId: localStorage.companyId
      }
    });
  },

  /**
   * @description: 通过员工名条件查询所有员工
   * @param null *
   * @return {Object}
   */
  getEmployeeListByCondition(params) {
    return zhreq.post("v3/organization/employee/queryByCondition", {
      // organizationNo: sessionStorage.getItem("organizationNo")
      organizationNo: sessionStorage.organizationNo,
      employeeName: params.employeeName
      // companyId: localStorage.companyId
    });
  },

  // /**
  //  * @description: 获取所有巡查点列表 *代表必填
  //  * @param {String} companyId *
  //  * @return {Array}
  //  */
  // getInspectionPointList() {
  //   return xjaxiosTwoline.post("v3/organization/inspectionPoint/queryByCondition", {
  //     companyId: localStorage.companyId
  //   });
  // },
  /**
   * @description: 新增员工信息
   * @param {Object} formData *
   * @return {Object}
   */
  addEmployeeInfo(formData) {
    formData.organizationNo = sessionStorage.organizationNo;
    return zhreq.post("v3/organization/employee/add", formData);
  },
  /**
   * @description: 编辑员工信息
   * @param {Object} formData *
   * @return {Object}
   */
  editEmployeeInfo(formData) {
    formData.organizationNo = sessionStorage.organizationNo
    return zhreq.post("v3/organization/employee/edit", formData);
  },
  /**
   * @description: 单个删除员工
   * @param {String} staff *
   * @return {Array}
   */
  delEmployeeById(employeeId) {
    return zhreq.get(`v3/organization/employee/del/${employeeId}`);
  }
};
